<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>腾讯播放量</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <script type="text/javascript" src="/js/jquery-latest.js"></script>
    <script type="text/javascript" src="/js/layer/layer.js"></script>
    <script type="text/javascript" src="/js/vue.min.js"></script>
    <link rel="stylesheet" media="all" href="../static/css/demo.css" th:href="@{/css/demo.css}"/>
</head>
<body>
<div id="app">
    <input style="width: 300px;height: 30px" v-model="tengxunUrl" placeholder="视频链接">
    <br>
    <input style="width: 200px;height: 20px" v-model="count" placeholder="次数" onkeyup="value=value.replace(/[^\d]/g,'')">
    <br>
    <button @click="sub">提交</button>
    <p>https://v.qq.com/x/page/k0510q7xx1y.html</p>
    <br>
    <p>星星323</p>
</div>
</body>
</html>
<script>
    var app = new Vue({
        el: '#app',
        data: {
            tengxunUrl: '',
            count:1000
        },
        methods: {
            sub: function () {
                var tu = this.tengxunUrl.trim();
                var co = this.count;
                if (null == tu || '' == tu) {
                    layer.alert("链接不可为空");
                    return;
                } else if (tu.indexOf("v.qq.com")<0) {
                    layer.alert("链接非腾讯所有");
                    return;
                }
                if (!co>0){
                    layer.alert("次数必须为大于零的整数");
                    return;
                }
                var pa = encodeURIComponent(tu);
                var url = "/tx/start?u="+pa+"&c="+co;
            /*    $.get(url,function(data){
                    alert(data)
                })*/
                $.get(url);
                layer.alert("执行成功");
            }
        }
    })

</script>